package com.qf.team2.netdisc.config;

import java.io.FileWriter;
import java.io.IOException;


/**
 * 支付宝配置
 *
 * @author Simon_Wong
 * @date 2021/05/26 11:40
 */
public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    /**
     * 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
     */
    public static String app_id = "2021000117663741";

    /**
     * 应用私钥，您的PKCS8格式RSA2私钥
     */
    public static String merchant_private_key = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCYebVO8tOKZt" +
            "+W0hAxD1Ebg5t6fnDkHknjBry8bjcFHO896DtytngjzIKpCANC14f" +
            "+nihEL5cMTXZ8dI8lqdvjnVm4Vqucl9CY8XQjHehwgo4IKlr5R6iHN8BeLwfXrC1FpZbxXOP04dY6v5seMibGU8B39g3WiAY" +
            "+Uhi7hPfRavm0bfDi6EJ/SOKm9rR8Tm/Bq6arjo07z8Y39OlTTUDunh/cOJ27W1wdKNU" +
            "/i6yUugP2ORrrPBmicqwFFkPAYZYcGuI0uMoYJt/eD1AzfN7T8k774fCUeuNCETY3xrs" +
            "+Z2Cx0u5Z3GYkFNJ5qABZuuDRfQ0stFZAGsruxzeQi+N5AgMBAAECggEAcfRkQQDSgNmpuTp9x2y/HWUayk29aYAJkJb0b4" +
            "+fpz6cvxPVekJNP9QUwueuKEKU7QKe7Xbz2Mn8B7" +
            "/FTEzKfi6XY2HDGGGOEQBD4Ar2MUAhjpC5NR0NIyHTr5BOuC2CGE9NpE3cQKSYS4fwEn1A5XCqo/1NEkzO" +
            "/by1p1AVNnkpWhRtd1GPI0aCOkrq9r6iUmYsxXlXJ6ia9fms6tn/Sy/Q/yA6GUvhFGek5ZWyL4T/FNkhFD5+ko9kFyOy" +
            "+BuGKs2dTqNAfMpH1OIAIRjJg/8bItZEmVPcBDb89DrqSoIrMD8IX6LAgcRE+zPhIiXiw4PYW7PIP/eeYIJs" +
            "/V4uAQKBgQDOEjB8adH2ktCDxyzmTx2TYMXu5LlrPo2sggUyNxDCtrMEexGj53LFX" +
            "/SHew4HNUCyecWz8RKnuLXnZKT918ZGUprEEbiKa4yD9jCTxsUE65I66A08HBaZMXGziu5HtDcbxt6sI5CLe5YCbCbX" +
            "+pInX50nuJ9bwyTtqB4OcKRjMQKBgQC9ay8YNsbcJzrQZGnBH0eZ/rfFDdydL5+J7FpIDWChEDi7VzHB2mZu" +
            "+TPA30zfUcN1xSmXnpKhuH4I5OQ0uXhtgQTPhukBWgy22nWc5wQwJJUvecjVQPdcBfHwSsDAR7QYwCr3uq5H+bvjGfB7pw" +
            "/HNwJZ0kPUhfNtTNhMBMWiyQKBgGMbTmRXhFphC5WFEiwFusSpkygsqpxQblScB6G55/6tXXV3NumsI3+XgYQzA3EmBGKRvCqpc35kkF" +
            "+kANHwl3Q0wCgyGZ3A0ciZe41m2FRgc2iPN+ZD3/53UCa4V5b2rlZWk7sYM6lRm7i4iQnwgaAcFPoIiePY+4atBx" +
            "+MvxLRAoGASAufkwcqpgvpy9+VddYO5tzCSxoVole9x7j1Mdicu0YvPdpRW5lVQrpYW" +
            "/DTDVHNFVtTkY7H2OkSTxG4VvGAg64CBWkb8N6uXVJET9RyfFk9wRwCLlKSgxbjyfC01a2wK4XUEfuYVFoBg8SW+oE1eCFNLJrUH95" +
            "/E0CaOHfMMDkCgYArMClC7AGVTEd2lUbDB9c87gn3GW167ur4fGxfowifrw2f7PjkhCbkbgDXK8ND0DM7xKsdQidRv/40rtPx4" +
            "+oY4Wz6RMuaJ+4U3Df+fM9caQ/5mqSbV8kp8bKJfELVp5f7NAXDIV0XhUsiioc++u4kden7WyUmyiw0Y+xZDVYiDw==";

    /**
     * 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
     */
    public static String alipay_public_key =
            "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAm6EXqnuUK5tnAaPRSxJU1eUlIKQqW9EWXn9KoIEODJV9mowRVe1omZw2Asis7ZEFHPp8RQBzaiZmWsHk6NKCiYJG+qeevGJFlz9OkxMXtT5V9PcbjnVB41Io2KUHKTtJd2tzpcA2UPvZalvuHt8oUcKx0Y3vha3sP5k4TyGQ17Asun3guIThr26gBJAsW9PnT+lIkAbD7NZHHVx4obN80Wy+Nm0IxlTaPwDOg9fekfT/36Sx4FPVhY1OhkSoy9kWZ56di+AblEkM+d3oN9gU81YZyt/lWXLojbVQ369gM+x+hivgrYLKNOlNlSpBe7MxPoENTXV57kYpou+sD9kyjwIDAQAB";

    /**
     * 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
     */
    public static String notify_url = "http://localhost:8080/views/view-api/notify_url.html";

    /**
     * 页面跳转同步通知页面路径 用户支付成功时跳转 需http://格式的完整路径，不能加?id=123这类自定义参数，必须用户端可以正常访问
     */
    public static String return_url = "http://localhost:8080/netdisc/views/view-api/return_url.html";

    /**
     * 签名方式
     */
    public static String sign_type = "RSA2";

    /**
     * 字符编码格式
     */
    public static String charset = "utf-8";

    /**
     * 支付宝网关
     */
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    /**
     * 日志路径
     */
    public static String log_path = "D:\\bf-netdisc\\log";

//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     *
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis() + ".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

